filtering history

Hi,

I want to sort all objects that "Object text" has changed since a date D.

I've done that by reading the history and verifying the changed attribute, but that does'nt turn.

As if there is was a problem in the for h in current Object do loop.

bool fSkip_Increment(Skip upd_skpList, string KeyValue)
{
        bool IsNewValue = false
        int NumReferences = 0 
        if(find(upd_skpList, KeyValue, NumReferences))
                delete(upd_skpList, KeyValue) 
        else IsNewValue = true  
        NumReferences++
        put (upd_skpList, KeyValue, NumReferences)
        return(IsNewValue)
} // end fSkip_Increment()

Object o
    int count
        Skip compte_user = createString () // création de la skip list
        int iNbEditeurs = 0
        string sNomEditeur
        
        for o in all m do{
                History h
                
                for h in current Object do {
                        HistoryType ht = h.type
                        string exigence = o."AS Exigence"
                        string sEditepar = o."Last Modified By"
                        print h.attrName "\n"
                        if (exigence == "TRUE"){
                                if (ht==modifyObject){
                                        if(h.attrName != "AS Suivi"){
                                                fSkip_Increment (compte_user, sEditepar)
                                        }
                                }
                        }
                }
        }
        for count in compte_user do{
                sEditepar = (string key compte_user)
                print count "\t" sEditepar "\n"
        }

 


Estebell - Wed Jul 23 10:53:40 EDT 2014

Re: filtering history
llandale - Wed Jul 23 15:44:09 EDT 2014

This looks very familiar.

  • Line  22 use variable "o" instead of "current Object".
  • Lines 24-27 should be moved above the History loop; ignoring this object unless it qualifies

-Louie

Nice initial function ;)

 

Re: filtering history
Estebell - Thu Jul 24 04:01:06 EDT 2014

llandale - Wed Jul 23 15:44:09 EDT 2014

This looks very familiar.

  • Line  22 use variable "o" instead of "current Object".
  • Lines 24-27 should be moved above the History loop; ignoring this object unless it qualifies

-Louie

Nice initial function ;)

 

By following your advice, the code does not enter into the History  loop...

    Object o
        int count
        Skip compte_user = createString ()
        int iNbEditeurs = 0
        string sNomEditeur
        
        for o in all m do{
                History h
                print "toto\n"
                string exigence = o."AS Exigence"
                string sEditepar = o."Last Modified By"
                if (exigence == "TRUE"){
                        for h in o do {
                                HistoryType ht = h.type
                                if (ht==modifyObject){
                                        if(h.attrName != "AS Suivi"){
                                                fSkip_Increment (compte_user, sEditepar)
                                        }
                                }
                        }
                }
        }
        for count in compte_user do{
                sEditepar = (string key compte_user)
                print count "\t" sEditepar "\n"
        }

 

Re: filtering history
O.Wilkop - Thu Jul 24 05:17:00 EDT 2014

Estebell - Thu Jul 24 04:01:06 EDT 2014

By following your advice, the code does not enter into the History  loop...

    Object o
        int count
        Skip compte_user = createString ()
        int iNbEditeurs = 0
        string sNomEditeur
        
        for o in all m do{
                History h
                print "toto\n"
                string exigence = o."AS Exigence"
                string sEditepar = o."Last Modified By"
                if (exigence == "TRUE"){
                        for h in o do {
                                HistoryType ht = h.type
                                if (ht==modifyObject){
                                        if(h.attrName != "AS Suivi"){
                                                fSkip_Increment (compte_user, sEditepar)
                                        }
                                }
                        }
                }
        }
        for count in compte_user do{
                sEditepar = (string key compte_user)
                print count "\t" sEditepar "\n"
        }

 

I tried your code on my DOORS and after adding Module m = current and changing the attribute names you are trying to access the program enters the "for h in o" without any problems. Have you verified that "AS Exigence" returns a value of "TRUE"? Maybe add some more print calls to see where exactly the program stops running.

Re: filtering history
llandale - Thu Jul 24 14:29:03 EDT 2014

O.Wilkop - Thu Jul 24 05:17:00 EDT 2014

I tried your code on my DOORS and after adding Module m = current and changing the attribute names you are trying to access the program enters the "for h in o" without any problems. Have you verified that "AS Exigence" returns a value of "TRUE"? Maybe add some more print calls to see where exactly the program stops running.

Yes, add this before your "TRUE" if.

  • print (identifier(o)) "\texigence = " exigence "\n"

I bet it's "true" or "True".

-Louie